package com.app.web.socketio
import com.corundumstudio.socketio.Configuration
import com.corundumstudio.socketio.SocketIOServer
import groovy.transform.CompileStatic
import groovy.transform.TypeChecked

/**
 * Created by three on 14-8-6.
 */
@CompileStatic
@TypeChecked
class MySocketIOServer {
    public static void main(String[] args) throws InterruptedException {

        Configuration config = new Configuration();
        config.setHostname("0.0.0.0");
        config.setPort(9091);

        final SocketIOServer server = new SocketIOServer(config);

        server.addListeners(new DemoEventListener());

        server.start();

        while(true) {
            int i= System.in.read();
            if(i=='q') break;
        }

        server.stop();
    }
}
